<template>
  <div class="top">
    <div class="avatar">
      科研经费管理系统
    </div>
    <div class="user">
      <span @click="logout">退出</span>
    </div>

  </div>
</template>

<script>
  export default {
    name: 'top',
    data () {
      return {};
    },
    methods: {
      logout () {
        this.$store.commit('setUser', null);
        this.$store.commit('setToken', '');
        this.$router.push('/login');
      }
    }
  };
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="stylus">

.user span{cursor: pointer}


</style>
